package com.cowin.sys.dao;

import com.cowin.base.Mapper;
import com.cowin.sys.model.TmBasWorkschedule;
import com.cowin.sys.model.dto.WorkAndRest;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TmBasWorkscheduleMapper extends Mapper<TmBasWorkschedule> {
    /**
     * 功能描述: 根据车间ID获取车间下的各产线作息信息<br>
     *
     * @param workshopId
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/12/26 14:17
     */
    @Select("SELECT tw.*,ts.TM_BAS_SHIFT_MODELCODE_ID tmBasShiftModelcodeId, ts.TM_BAS_WORKSECTION_ID tmBasWorksectionId, ts.WORKDATE workdate, ts.ADD_END_TIME addEndTime FROM TM_BAS_WORKSCHEDULE tw left join TM_BAS_SHIFT_MODELCODE ts on tw.TM_BAS_WORKSCHEDULE_ID = ts.TM_BAS_WORKSCHEDULE_ID\n" +
            "where  ts.TM_BAS_WORKSECTION_ID = #{workshopId}")
    List<WorkAndRest> getWorkshopSchedule(Long workshopId);
}